<?php

include("mysql_conn.php");

$updateid = mysql_real_escape_string($_POST["updateid"]);
$updatetext = mysql_real_escape_string($_POST["updatetext"]);
$updatedate = mysql_real_escape_string($_POST["updatedate"]);
$updatetype = mysql_real_escape_string($_POST["updatetype"]);
$projectid = $_POST["projectid"];

$sql="update updates set updatetext='$updatetext',updatedate=str_to_date('$updatedate','%m/%d/%Y'),updatetype='$updatetype' where updateid='$updateid'";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "<html><head><meta http-equiv='refresh' content='0;url=editproj.php?projectid=$projectid'><link rel='stylesheet' type='text/css' href='style.css'></head><body>
Update edited successfully.<p>
<a href='editproj.php?projectid=$projectid'>Return to Project</a>
</body></html>";

mysql_close($con)
?>
